#!/bin/sh
#
# $FreeBSD: head/www/hiawatha/files/php-fcgi.in 300897 2012-07-14 14:29:18Z beat $
#

# PROVIDE: php_fcgi
# REQUIRE: LOGIN
# KEYWORD: shutdown

# Add the following line(s) to /etc/rc.conf:
# php_fcgi_enable (bool):		Set to "NO" by default, set it
#					to "YES" to enable php_fcgi.

. /etc/rc.subr

name="php_fcgi"
rcvar=php_fcgi_enable

load_rc_config $name

: ${php_fcgi_enable="NO"}

command="/usr/local/sbin/php-fcgi"
pidfile=${php_fcgi_pidfile="/var/run/php-fcgi.pid"}
procname=${php_fcgi_app="/usr/local/bin/php-cgi"}

stop_postcmd="${name}_stop_postcmd"

php_fcgi_stop_postcmd()
{
    rm -f ${pidfile}
}

run_rc_command "$1"
